<!DOCTYPE html>
<html lang=zh>
<head>
    <!-- so meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="HandheldFriendly" content="True">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="什么是XPath?xpath(XML Path Language)是一门在XML和HTMl文档中查找信息的语言,可用来在XML和HTML文档中对元素和属性进行遍历.    XPath开发工具 Chrome插件XPath Helper. Firefox插件XPath Checker和Try XPath  XPath语法使用方式使用&#x2F;&#x2F;获取整个界面当中的元素，然后写签名，然后再写谓词进行提取。比如 1">
<meta property="og:type" content="article">
<meta property="og:title" content="Xpath使用教程">
<meta property="og:url" content="https:&#x2F;&#x2F;fengzxia.gitee.io&#x2F;posts&#x2F;6e7a1eef.html">
<meta property="og:site_name" content="只是学习学习的博客">
<meta property="og:description" content="什么是XPath?xpath(XML Path Language)是一门在XML和HTMl文档中查找信息的语言,可用来在XML和HTML文档中对元素和属性进行遍历.    XPath开发工具 Chrome插件XPath Helper. Firefox插件XPath Checker和Try XPath  XPath语法使用方式使用&#x2F;&#x2F;获取整个界面当中的元素，然后写签名，然后再写谓词进行提取。比如 1">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2019-08-31T05:21:26.000Z">
<meta property="article:modified_time" content="2020-04-16T12:11:10.419Z">
<meta property="article:author" content="只是学习学习">
<meta property="article:tag" content="Java">
<meta property="article:tag" content="Python">
<meta property="article:tag" content="Spider">
<meta property="article:tag" content="Spring">
<meta property="article:tag" content="Redis">
<meta property="article:tag" content="Mybatis">
<meta property="article:tag" content="Mysql">
<meta name="twitter:card" content="summary">
    
    
        
          
              <link rel="shortcut icon" href="/images/favicon.ico">
          
        
        
          
            <link rel="icon" type="image/png" href="/images/favicon-192x192.png" sizes="192x192">
          
        
        
          
            <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
          
        
    
    <!-- title -->
    <title>Xpath使用教程</title>
    <!-- styles -->
    
<link rel="stylesheet" href="/css/style.css">

    <!-- persian styles -->
    
      
<link rel="stylesheet" href="/css/rtl.css">

    
    <!-- rss -->
    
    
    
<meta name="generator" content="Hexo 4.1.1"></head>

<body class="max-width mx-auto px3 ltr">
    
      <div id="header-post">
  <a id="menu-icon" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="menu-icon-tablet" href="#"><i class="fas fa-bars fa-lg"></i></a>
  <a id="top-icon-tablet" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');" style="display:none;"><i class="fas fa-chevron-up fa-lg"></i></a>
  <span id="menu">
    <span id="nav">
      <ul>
         
          <li><a href="/">主页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/categories/">分类</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/about/">关于</a></li>
         
          <li><a href="/friend_ship/">友链</a></li>
        
      </ul>
    </span>
    <br/>
    <span id="actions">
      <ul>
        
        <li><a class="icon" href="/posts/f8d87466.html"><i class="fas fa-chevron-left" aria-hidden="true" onmouseover="$('#i-prev').toggle();" onmouseout="$('#i-prev').toggle();"></i></a></li>
        
        
        <li><a class="icon" href="/posts/1950a942.html"><i class="fas fa-chevron-right" aria-hidden="true" onmouseover="$('#i-next').toggle();" onmouseout="$('#i-next').toggle();"></i></a></li>
        
        <li><a class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up" aria-hidden="true" onmouseover="$('#i-top').toggle();" onmouseout="$('#i-top').toggle();"></i></a></li>
        <li><a class="icon" href="#"><i class="fas fa-share-alt" aria-hidden="true" onmouseover="$('#i-share').toggle();" onmouseout="$('#i-share').toggle();" onclick="$('#share').toggle();return false;"></i></a></li>
      </ul>
      <span id="i-prev" class="info" style="display:none;">上一篇</span>
      <span id="i-next" class="info" style="display:none;">下一篇</span>
      <span id="i-top" class="info" style="display:none;">返回顶部</span>
      <span id="i-share" class="info" style="display:none;">分享文章</span>
    </span>
    <br/>
    <div id="share" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=https://fengzxia.gitee.io/posts/6e7a1eef.html" target="_blank" rel="noopener"><i class="fab fa-facebook " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&text=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-twitter " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-linkedin " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&is_video=false&description=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-pinterest " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=Xpath使用教程&body=Check out this article: https://fengzxia.gitee.io/posts/6e7a1eef.html"><i class="fas fa-envelope " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-get-pocket " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-reddit " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-stumbleupon " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-digg " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&name=Xpath使用教程&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr " aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=https://fengzxia.gitee.io/posts/6e7a1eef.html&t=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-hacker-news " aria-hidden="true"></i></a></li>
</ul>

    </div>
    <div id="toc">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#什么是XPath"><span class="toc-number">1.</span> <span class="toc-text">什么是XPath?</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#XPath开发工具"><span class="toc-number">2.</span> <span class="toc-text">XPath开发工具</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#XPath语法"><span class="toc-number">3.</span> <span class="toc-text">XPath语法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#使用方式"><span class="toc-number">3.1.</span> <span class="toc-text">使用方式</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#需要注意的知识点"><span class="toc-number">3.2.</span> <span class="toc-text">需要注意的知识点</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#选取节点"><span class="toc-number">3.3.</span> <span class="toc-text">选取节点</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#谓语"><span class="toc-number">3.4.</span> <span class="toc-text">谓语</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#通配符"><span class="toc-number">3.5.</span> <span class="toc-text">通配符</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#选取多个路径"><span class="toc-number">3.6.</span> <span class="toc-text">选取多个路径</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#运算符"><span class="toc-number">3.7.</span> <span class="toc-text">运算符</span></a></li></ol></li></ol>
    </div>
  </span>
</div>

    
    <div class="content index py4">
        
        <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
  <header>
    
    <h1 class="posttitle" itemprop="name headline">
        Xpath使用教程
    </h1>



    <div class="meta">
      <span class="author" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <span itemprop="name">只是学习学习的博客</span>
      </span>
      
    <div class="postdate">
      
        <time datetime="2019-08-31T05:21:26.000Z" itemprop="datePublished">2019-08-31</time>
        
      
    </div>


      
    <div class="article-category">
        <i class="fas fa-archive"></i>
        <a class="category-link" href="/categories/Python/">Python</a> › <a class="category-link" href="/categories/Python/%E7%88%AC%E8%99%AB/">爬虫</a> › <a class="category-link" href="/categories/Python/%E7%88%AC%E8%99%AB/Xpath/">Xpath</a>
    </div>


      

    </div>
  </header>
  

  <div class="content"itemprop ="articleBody">
    <h2 id="什么是XPath"><a href="#什么是XPath" class="headerlink" title="什么是XPath?"></a>什么是XPath?</h2><p>xpath(XML Path Language)是一门在XML和HTMl文档中查找信息的语言,可用来在XML和HTML文档中对元素和属性进行遍历.   </p>
<h2 id="XPath开发工具"><a href="#XPath开发工具" class="headerlink" title="XPath开发工具"></a>XPath开发工具</h2><ol>
<li>Chrome插件XPath Helper.</li>
<li>Firefox插件XPath Checker和Try XPath</li>
</ol>
<h2 id="XPath语法"><a href="#XPath语法" class="headerlink" title="XPath语法"></a>XPath语法</h2><h3 id="使用方式"><a href="#使用方式" class="headerlink" title="使用方式"></a>使用方式</h3><p>使用//获取整个界面当中的元素，然后写签名，然后再写谓词进行提取。比如</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F;div[@class&#x3D;&#39;abc&#39;]</span><br></pre></td></tr></table></figure>
<h3 id="需要注意的知识点"><a href="#需要注意的知识点" class="headerlink" title="需要注意的知识点"></a>需要注意的知识点</h3><ol>
<li><code>/</code> 和 <code>//</code> 的区别：<ul>
<li>/代表只获取直接子节点。</li>
<li>//获取子孙节点。一般//用得比较多。当然也要视情况而定。</li>
</ul>
</li>
<li>contains: 有时候某个属性中包含了多个值，那么可以使用<code>contains</code>函数。实例代码如下 <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F;div[contains(@class, &#39;job_detail&#39;)]</span><br></pre></td></tr></table></figure></li>
<li>谓语中的下标是从1开始的，不是从0开始<h3 id="选取节点"><a href="#选取节点" class="headerlink" title="选取节点"></a>选取节点</h3>XPath使用路径表达式来选取XML文档中的节点或者节点集.这些路径表达式和我们在常规的电脑文件系统中看到的表达式非常相似.</li>
</ol>
<table>
<thead>
<tr>
<th>表达式</th>
<th>描述</th>
<th>示例</th>
<th>结果</th>
</tr>
</thead>
<tbody><tr>
<td>nodename</td>
<td>选取此节点的所有子节点</td>
<td>bookstore</td>
<td>选取bookstore下所有的子节点</td>
</tr>
<tr>
<td>/</td>
<td>如果在最前面,代表从根节点选取.否则选择某节点下的某个子节点</td>
<td>/bookstore</td>
<td>选取根元素下所有的bookstore节点</td>
</tr>
<tr>
<td>//</td>
<td>从全局节点中选择节点,随便在哪个位置</td>
<td>//book</td>
<td>从全局节点中找到所有的book节点</td>
</tr>
<tr>
<td>@</td>
<td>选取某个节点的属性</td>
<td>//book[@class]</td>
<td>选择所有book中拥有class属性的节点</td>
</tr>
</tbody></table>
<h3 id="谓语"><a href="#谓语" class="headerlink" title="谓语"></a>谓语</h3><p>谓语用来查找某个特定的节点或者包含某个指定的值的节点,被嵌在方括号中.<br>在下面的表格中,我们列出了带有谓语的一些路径表达式,以及表达的结果</p>
<table>
<thead>
<tr>
<th>路径表达式</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>/bookstore/book[1]</td>
<td>选取bookstore下的第一个子元素</td>
</tr>
<tr>
<td>/bookstore/book[last()]</td>
<td>选取bookstore下的最后一个book元素</td>
</tr>
<tr>
<td><code>/bookstore/book[position()&lt;3]</code></td>
<td>选取bookstore下前面两个子元素</td>
</tr>
<tr>
<td>/book[@price]</td>
<td>选取拥有price属性的book元素</td>
</tr>
<tr>
<td>/book[@price=10]</td>
<td>选取所有属性price等于10的book元素</td>
</tr>
<tr>
<td>/book[contains(@class, ‘fl’)]</td>
<td>模糊匹配class属性中有<code>fl</code>值的标签</td>
</tr>
</tbody></table>
<h3 id="通配符"><a href="#通配符" class="headerlink" title="通配符"></a>通配符</h3><p>*表示通配符.</p>
<table>
<thead>
<tr>
<th>通配符</th>
<th>描述</th>
<th>示例</th>
<th>结果</th>
</tr>
</thead>
<tbody><tr>
<td>*</td>
<td>匹配任意节点</td>
<td>/bookstore/*</td>
<td>选取bookstore下的所有子元素.</td>
</tr>
<tr>
<td>@*</td>
<td>匹配节点中的任意属性</td>
<td>//book[@*]</td>
<td>选取所有带属性的book元素.</td>
</tr>
</tbody></table>
<h3 id="选取多个路径"><a href="#选取多个路径" class="headerlink" title="选取多个路径"></a>选取多个路径</h3><p>通过在路径表达式中使用”|”运算符,可以选择若干路径</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&#x2F;&#x2F;bookstore&#x2F;book | &#x2F;&#x2F;book&#x2F;title</span><br><span class="line"># 选取所有book元素以及book元素下所有的title元素</span><br></pre></td></tr></table></figure>

<h3 id="运算符"><a href="#运算符" class="headerlink" title="运算符"></a>运算符</h3><table>
<thead>
<tr>
<th>运算符</th>
<th>描述</th>
<th>示例</th>
<th>返回值</th>
</tr>
</thead>
<tbody><tr>
<td>&#124;</td>
<td>计算两个节点集</td>
<td>//book &#124; //cd</td>
<td>返回所拥有book和cd元素的节点集</td>
</tr>
<tr>
<td>+</td>
<td>加法</td>
<td>6 + 4</td>
<td>10</td>
</tr>
<tr>
<td>-</td>
<td>减法</td>
<td>6 - 4</td>
<td>2</td>
</tr>
<tr>
<td>*</td>
<td>乘法</td>
<td>6 * 4</td>
<td>24</td>
</tr>
<tr>
<td>div</td>
<td>除法</td>
<td>8 div 4</td>
<td>2</td>
</tr>
<tr>
<td>=</td>
<td>等于</td>
<td>price=9.80</td>
<td>如果price是9.80,则返回true.如果price是9.90,则返回false</td>
</tr>
<tr>
<td>!=</td>
<td>不等于</td>
<td>price != 9.80</td>
<td>如果price是9.90,则返回true.如果price是9.80,则返回false</td>
</tr>
<tr>
<td>&lt;</td>
<td>小于</td>
<td>price &lt; 9.80</td>
<td>如果price是9.00,则返回true.如果price是9.90,则返回false</td>
</tr>
<tr>
<td>&lt;=</td>
<td>小于等于</td>
<td>price &lt;= 9.80</td>
<td>如果price是9.00,则返回true.如果price是9.90,则返回false</td>
</tr>
<tr>
<td>&gt;</td>
<td>大于</td>
<td>price &gt; 9.80</td>
<td>如果price是9.90,则返回true.如果price是9.00,则返回false</td>
</tr>
<tr>
<td>&gt;=</td>
<td>大于等于</td>
<td>price &gt;= 9.80</td>
<td>如果price是9.90,则返回true.如果price是9.00,则返回false</td>
</tr>
<tr>
<td>or</td>
<td>或者</td>
<td>price = 9.80 or price = 9.70</td>
<td>如果price是9.80,则返回true.如果price是9.50,则返回false</td>
</tr>
<tr>
<td>and</td>
<td>与,并且</td>
<td>price &amp;gt 9 and price &lt; 9.90</td>
<td>如果price是9.80,则返回true.如果price是8.50,则返回false</td>
</tr>
<tr>
<td>mod</td>
<td>计算除法的余数</td>
<td>5 mod 2</td>
<td>1</td>
</tr>
</tbody></table>

<div id="gitalk-container"></div>
<script src="https://cdn.bootcss.com/blueimp-md5/2.12.0/js/md5.min.js"></script><link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css"><script src="https://unpkg.com/gitalk/dist/gitalk.min.js"></script>

		<script>
		var gitalkConfig = {"clientID":"28a065e3b5afee156f4f","clientSecret":"e18104d6f3219526491fc42c892ff6a26b8f3e74","repo":"blog_comment","owner":"FENG1000","admin":["FENG1000"],"distractionFreeMode":false};
	    gitalkConfig.id = md5(location.pathname);
		var gitalk = new Gitalk(gitalkConfig);
	    gitalk.render("gitalk-container");
	    </script>
    
  <blockquote>
      <p>
          作者: 只是学习学习<br>
          邮箱: fengzxia1000@163.com<br>
          原文地址: <a href="https://fengzxia.gitee.io/posts/6e7a1eef.html" target="_blank" rel="noopener">https://fengzxia.gitee.io/posts/6e7a1eef.html</a><br>
          版权声明: 商业转载请联系作者获得授权，非商业转载请注明出处。
      </p>
  </blockquote>

  <script>
      function setClipboardText(event){
          // clipboardData 对象是为通过编辑菜单、快捷菜单和快捷键执行的编辑操作所保留的，也就是你复制或者剪切内容
          let clipboardData = event.clipboardData || window.clipboardData;
          // 如果未复制或者未剪切，则return出去
          if (!clipboardData) { return; }
          event.preventDefault();
          // Selection 对象，表示用户选择的文本范围或光标的当前位置。
          //     声明一个变量接收 -- 用户输入的剪切或者复制的文本转化为字符串
          let text = window.getSelection().toString();

          if (text) {
            // 如果文本存在则先取消文本默认事件
            event.preventDefault();
            // 通过调用常clipboardData对象的 setData(format, data) 方法；来设置相关文本
            // format: 一个DOMString 表示要添加到 drag object的拖动数据的类型。
            // data: 一个 DOMString表示要添加到 drag object的数据。
            var copyright = '\n\n'
                            + '\n著作权归作者所有。'
                            + '\n商业转载请联系作者获得授权，非商业转载请注明出处。'
                            + '\n作者: 只是学习学习'
                            + '\n邮箱: fengzxia1000@163.com'
                            + '\n原文地址: https://fengzxia.gitee.io/posts/6e7a1eef.html'

            clipboardData.setData('text/plain', text + copyright);

          }
      };
      var contents = document.getElementsByClassName("content");
      // 监听文章内容的copy事件
      contents[0].addEventListener('copy',function(e){
          setClipboardText(e);
      });
  </script>

  </div>
</article>




        
          <div id="footer-post-container">
  <div id="footer-post">

    <div id="nav-footer" style="display: none">
      <ul>
         
          <li><a href="/">主页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/categories/">分类</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/about/">关于</a></li>
         
          <li><a href="/friend_ship/">友链</a></li>
        
      </ul>
    </div>

    <div id="toc-footer" style="display: none">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#什么是XPath"><span class="toc-number">1.</span> <span class="toc-text">什么是XPath?</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#XPath开发工具"><span class="toc-number">2.</span> <span class="toc-text">XPath开发工具</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#XPath语法"><span class="toc-number">3.</span> <span class="toc-text">XPath语法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#使用方式"><span class="toc-number">3.1.</span> <span class="toc-text">使用方式</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#需要注意的知识点"><span class="toc-number">3.2.</span> <span class="toc-text">需要注意的知识点</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#选取节点"><span class="toc-number">3.3.</span> <span class="toc-text">选取节点</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#谓语"><span class="toc-number">3.4.</span> <span class="toc-text">谓语</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#通配符"><span class="toc-number">3.5.</span> <span class="toc-text">通配符</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#选取多个路径"><span class="toc-number">3.6.</span> <span class="toc-text">选取多个路径</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#运算符"><span class="toc-number">3.7.</span> <span class="toc-text">运算符</span></a></li></ol></li></ol>
    </div>

    <div id="share-footer" style="display: none">
      <ul>
  <li><a class="icon" href="http://www.facebook.com/sharer.php?u=https://fengzxia.gitee.io/posts/6e7a1eef.html" target="_blank" rel="noopener"><i class="fab fa-facebook fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://twitter.com/share?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&text=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-twitter fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.linkedin.com/shareArticle?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-linkedin fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://pinterest.com/pin/create/bookmarklet/?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&is_video=false&description=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-pinterest fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="mailto:?subject=Xpath使用教程&body=Check out this article: https://fengzxia.gitee.io/posts/6e7a1eef.html"><i class="fas fa-envelope fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://getpocket.com/save?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-get-pocket fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://reddit.com/submit?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-reddit fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.stumbleupon.com/submit?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-stumbleupon fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://digg.com/submit?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&title=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-digg fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="http://www.tumblr.com/share/link?url=https://fengzxia.gitee.io/posts/6e7a1eef.html&name=Xpath使用教程&description=" target="_blank" rel="noopener"><i class="fab fa-tumblr fa-lg" aria-hidden="true"></i></a></li>
  <li><a class="icon" href="https://news.ycombinator.com/submitlink?u=https://fengzxia.gitee.io/posts/6e7a1eef.html&t=Xpath使用教程" target="_blank" rel="noopener"><i class="fab fa-hacker-news fa-lg" aria-hidden="true"></i></a></li>
</ul>

    </div>

    <div id="actions-footer">
        <a id="menu" class="icon" href="#" onclick="$('#nav-footer').toggle();return false;"><i class="fas fa-bars fa-lg" aria-hidden="true"></i> 菜单</a>
        <a id="toc" class="icon" href="#" onclick="$('#toc-footer').toggle();return false;"><i class="fas fa-list fa-lg" aria-hidden="true"></i> 目录</a>
        <a id="share" class="icon" href="#" onclick="$('#share-footer').toggle();return false;"><i class="fas fa-share-alt fa-lg" aria-hidden="true"></i> 分享</a>
        <a id="top" style="display:none" class="icon" href="#" onclick="$('html, body').animate({ scrollTop: 0 }, 'fast');"><i class="fas fa-chevron-up fa-lg" aria-hidden="true"></i> 返回顶部</a>
    </div>

  </div>
</div>

        
        <footer id="footer">
  <div class="footer-left">
    Copyright &copy;
    
    
    2019-2020
    只是学习学习
  </div>
  <div class="footer-right">
    <nav>
      <ul>
         
          <li><a href="/">主页</a></li>
         
          <li><a href="/archives/">归档</a></li>
         
          <li><a href="/categories/">分类</a></li>
         
          <li><a href="/tags/">标签</a></li>
         
          <li><a href="/search/">搜索</a></li>
         
          <li><a href="/about/">关于</a></li>
         
          <li><a href="/friend_ship/">友链</a></li>
        
      </ul>
    </nav>
  </div>
</footer>

    </div>
    <!-- styles -->

<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">


<link rel="stylesheet" href="/lib/justified-gallery/css/justifiedGallery.min.css">


    <!-- jquery -->

<script src="/lib/jquery/jquery.min.js"></script>


<script src="/lib/justified-gallery/js/jquery.justifiedGallery.min.js"></script>

<!-- clipboard -->

  
<script src="/lib/clipboard/clipboard.min.js"></script>

  <script type="text/javascript">
  $(function() {
    // copy-btn HTML
    var btn = "<span class=\"btn-copy tooltipped tooltipped-sw\" aria-label=\"复制到粘贴板!\">";
    btn += '<i class="far fa-clone"></i>';
    btn += '</span>'; 
    // mount it!
    $(".highlight table").before(btn);
    var clip = new ClipboardJS('.btn-copy', {
      text: function(trigger) {
        return Array.from(trigger.nextElementSibling.querySelectorAll('.code')).reduce((str,it)=>str+it.innerText+'\n','')
      }
    });
    clip.on('success', function(e) {
      e.trigger.setAttribute('aria-label', "复制成功!");
      e.clearSelection();
    })
  })
  </script>


<script src="/js/main.js"></script>

<!-- search -->

<!-- Google Analytics -->

<!-- Baidu Analytics -->

    <script type="text/javascript">
        var _hmt = _hmt || [];
        (function() {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?54382acbd8c4bc66535bce135e0ac166";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>

<!-- Disqus Comments -->


</body>
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https'){
   bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
  }
  else{
  bp.src = 'http://push.zhanzhang.baidu.com/push.js';
  }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
</html>
